package com.bunnyhsu.service.impl;

import com.bunnyhsu.mapper.TypeMapper;
import com.bunnyhsu.model.Type;
import com.bunnyhsu.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by xl on 2018/4/10.
 */
@Service
public class TypeServiceImpl implements TypeService{
    @Autowired
    private TypeMapper typeMapper;
    @Override
    public String getTypeById(int id) {
        String result = typeMapper.selectTypeById(id);
        return result!=null ? result:"";
    }

    @Override
    public List<Type> getAllTypes() {
        return typeMapper.selectTypes();
    }
}
